program to count no of words in a string